import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  // templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],
  template:`
    <router-outlet></router-outlet>
  `,
})
export class AppComponent {
  data = 'demo';
  public flag:boolean = false;
  // 推荐数据
  imgTop = [{ imgUrl:'../assets/images/7.jpeg',isTop:true ,title:'新年美装低价钜献',age:29},]
  // 普通数据
  newImg = [
    { imgUrl:'../assets/images/4.jpeg',isTop:false,title:'美邦轻薄羽绒服',age:189 },
    { imgUrl:'../assets/images/3.jpeg',isTop:false,title:'韩版中长条棉衣',age:219 },
    { imgUrl:'../assets/images/6.jpeg',isTop:false,title:'丝绒半身裙',age:128 },
    { imgUrl:'../assets/images/1.jpeg',isTop:false,title:'高领长款毛衣',age:158 },
    { imgUrl:'../assets/images/5.jpeg',isTop:false,title:'达芙妮显瘦高筒靴',age:159 },
    { imgUrl:'../assets/images/2.jpeg',isTop:false,title:'加绒长款卫衣',age:181 },
  ];
  topWidth = '40%';
  // 判断鼠标移入的全局index
  listIndex = 999;
  /*鼠标移入宫格*/
  addLook(e:number){
    this.listIndex = e;
  };
  // 鼠标移入
  addSeout(){
    this.listIndex = 999;
  };
  // 删除普通商品
  deleNew(e:number){
    this.newImg.splice(e, 1);
  };
  // 删除推荐商品
  dele(){
    // @ts-ignore: Unresolved function or method splice()
    this.imgTop.splice(0);
    this.topWidth = '0%'
    console.log(this.imgTop)
  };
}
